<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="no" />
<meta name="format-detection" content="telephone=no" />
<meta name="HandheldFriendly" content="true" />
<script type="text/javascript" src="http://media1.youanbao.com.cn/static/parent/Content/js/hb.js?v=1111"></script>
<link href="{OSSURL}public/mobile/css/new_yab1.css?v=11111009" rel="stylesheet" />
<link href="{OSSURL}public/mobile/css/baby_video.css" rel="stylesheet" />
{php echo register_jssdk();}
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{MODULE_URL}public/mobile/js/jquery-1.11.3.min.js?v=4.8"></script>
{php include $this->template('port');}
<style type="text/css">
.header { width: 100%; height: 50px; line-height: 50px; position: fixed; z-index: 1000; top: 0; left: 0; box-shadow: 0 0 2px 0px rgba(0,0,0,0.3),0 0 6px 2px rgba(0,0,0,0.15); }
.header .l { width: 50px; height: 50px; line-height: 50px; color: white; position: absolute; left: 0; top: 0; } 
.header .m { width: 100%; height: 50px; line-height: 50px; text-align: center; color: white; font-size: 18px; } 
.header .r { width: 50px; height: 50px; line-height: 50px; position: absolute; right: 0; top: 0; } 
.mainColor { background: #14c682 !important; } 
.header .l a { font-size: 18px; color: white; display: block; width: 100%; height: 100%; text-align: center; }
.header .m a i {float: left;margin: 23px 0 0 5px;width: 0;height: 0;border-width: 6px 6px 0;border-style: solid;border-color: white transparent transparent;position: absolute;}
.baby_video_list > li > a .video_box .v_play_icon{background: url({OSSURL}public/mobile/img/bv_play_icon.png) no-repeat center; background-size: 46px; width: 50px; height: 50px; z-index: 2; left: 50%; top: 35px; position: absolute; margin-left: -25px; }
.control_box_li .praise_btn_icon{  height: 36px; background: url({OSSURL}public/mobile/img/bv_praise_icon2.png) no-repeat left center; background-size: 16px; display: inline-block; padding-left: 24px; font-size: 10px; color: #aaaaaa; }
.control_box_li .praise_btn_icon.act{background: url({OSSURL}public/mobile/img/bv_praise_icon.png) no-repeat left center; background-size: 16px; }
.control_box_li .comment_btn_icon{ height: 36px; background: url({OSSURL}public/mobile/img/bv_comment_icon.png) no-repeat left center; background-size: 16px; display: inline-block; padding-left: 24px; font-size: 10px; color: #aaaaaa; }
.control_box_li .share_btn_icon{ height: 36px; background: url({OSSURL}public/mobile/img/bv_share_icon.png) no-repeat left center; background-size: 12px; display: inline-block; padding-left: 20px; font-size: 16px; color: #aaaaaa; }
.control_box_li .more_btn_icon{  height: 36px; background: url({OSSURL}public/mobile/img/bv_more_icon.png) no-repeat left center; background-size: 16px; display: inline-block; padding-left: 24px; font-size: 16px; color: #aaaaaa; }
.control_box_li .more_btn_icon a{ display: inline-block; height: 36px; color: #aaaaaa;}
.control_box_li .see_btn_icon{  height: 36px; background: url({OSSURL}public/mobile/img/look_icon.png) no-repeat left center; background-size: 16px; display: inline-block; padding-left: 24px; font-size: 10px; color: #aaaaaa; }
.control_box_li .see_btn_icon a{ display: inline-block; height: 36px; color: #aaaaaa;}
.bv_comment_list .comment_li .reply_btn{ display: inline-block; padding-left:20px; line-height: 20px; height: 20px; background: url({OSSURL}public/mobile/img/bv_reply_icon.png) no-repeat left center; background-size: 16px; font-size: 14px; color: #e5457f; float: right;}
.bv_comment_list .comment_li .sec_comment_li .reply_btn{ display: inline-block; padding-left:20px; line-height: 20px; height: 20px; background: url({OSSURL}public/mobile/img/bv_reply_icon.png) no-repeat left center; background-size: 16px; font-size: 14px; color: #e5457f; float: right; }
.bv_info_list li a .text .like_icon{ width: 20px; height: 20px; background: url({OSSURL}public/mobile/img/like_icon3_1.png) no-repeat center; background-size: 16px;}
.other_video_list li a .video_content .video_other_info{ font-size: 12px; color: #000; line-height: 16px; padding-left: 30px; background: url({OSSURL}public/mobile/img/bv_play_icon.png) no-repeat left center; background-size: 16px;}
.empty_video{ height: 250px; width: 100%; background: url("{MODULE_URL}public/mobile/img/empty_video.png") no-repeat center; background-size: 180px; }
.empty_video_2{ height: 190px; width: 100%; background: url("{MODULE_URL}public/mobile/img/empty_video.png") no-repeat center; background-size: 180px; }
.selectList{position:fixed; left:0; right:0; top:0; bottom:0;-webkit-box-sizing:border-box; box-sizing:border-box; background-color:rgba(0,0,0,.53); text-align:center; z-index:30;font-size:20px;color:#fe6700;}
.selectList .single{ position:absolute; left:6%; right:6%; top:35%; padding: 0 20px; background-color:#fff; padding-bottom:33px; padding-top: 10px;}
.selectList ul{width:100%;height:auto;overflow:auto;}
.selectList ul li{height:50px;line-height:50px;border-bottom:1px solid #e9e9e9;padding:0 10px;}
.selectList ul li.selected{border-left:5px solid #ffc74e;}
.selectList ul li span.le{height:50px;line-height:50px;float:left;font-size:16px;}
.selectList ul li span.ri{float:right;height:50px;line-height:50px;font-size:16px;}
</style>
<title>{$school['title']}</title>
</head>
<body>
<div class="header mainColor">
	<div class="l">
		<a class="backOff" style="background:url({OSSURL}public/mobile/img/ic_arrow_left_48px_white.svg) no-repeat;background-size: 55% 55%;background-position: 50%;" href="javascript:history.go(-1);"></a>
	</div>
	<div class="m">
		<a id="Changesf">
			<span style="font-size: 18px">{$school['videoname']}</span>
		</a>
	</div>
</div> 
<div class="video_detail_box" style="margin-top:70px;">
    <div class="main_video_box">
        <div class="til">{$name}</div>
        <div class="blank"></div>
        <div class="video_box">
			{if date('H:i',TIMESTAMP) > $start && $end > date('H:i',TIMESTAMP) }
                <video id="video" controls  poster="{php echo tomedia($pic)}" webkit-playsinline>
                    <source src="{php echo tomedia($thisvideo)}" type='video/mp4' />
                </video>
			{else}	
				<div class="mask"><div class="mask-content">已到直播结束时间，下回再见！</div></div>
				<video id="video" preload="auto" src="" poster="" controls="controls" webkit-playsinline></video>
			{/if}	
        </div>
    </div>
	<div class="control_box">
			<div class="control_box_li">
				{if $myisdz}<div class="praise_btn_icon act">{else}<div class="praise_btn_icon">{/if}{$mydzsl}</div>
			</div>
			<div class="control_box_li">
				<div class="comment_btn_icon">{$myplsl}</div>
			</div>
			<div class="control_box_li">
				<div class="see_btn_icon">{$thisclick}</div>
			</div>
		</div>
	</div>
<div class="comment_til">
	<div class="comment_til_text">
		评论
	</div>
</div>
<ul class="bv_info_list" style="margin-bottom: 20px;">
	{if $allpl}
	{loop $allpl $row1}
		<li {if $row1['userid'] == $it['id']}is_mine="true"{else}is_mine="false"{/if} comment_id="{$row1['id']}">
			<a>
				<div class="user_img">
						<img src="{php echo tomedia($row1['icon'])}" class="teacherImgError" />
					<div class="clear"></div>
				</div>
				<div class="text" style="min-height: 40px;">
					<div class="user_name">{$row1['name']}</div>
					<div class="comment_time">{$row1['time']}前</div>
					<div class="clear1"></div>
					<div class="comment_text">{$row1['conet']}</div>
					<div class="clear"></div>
				</div>
			</a>
			<div class="clear"></div>
		</li>
	{/loop}	
	{else}	
		<li class="default_comment">暂时还没有人评论哟！</li>
	{/if}	
</ul>
<div class="top_height_blank"></div>
<div class="bottom_say_box hide" style="display: block">
	<div class="reply_box" id="reply">
		<input type="text" value="" maxlength="200" class="reply_input" placeholder="请输入内容(200字以内)">
		<div class="reply_btn">评论</div>
	</div>
</div>
<div class="del_comment_bg">
	<div class="del_comment_btn" comment_id="">
		删除评论
	</div>
</div>
<input type="hidden" id="session_visit_sign" value="0" />
<input type="hidden" id="myicon" value="{php echo tomedia($myicon)}" />
<input type="hidden" id="thisvideo" value="{php echo tomedia($thisvideo)}" />
<input type="hidden" id="allowpy" value="{$allowpy}" />
</body>
</html>
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.80309"></script>
<script>
        var nowHour = parseInt('15');
        var nowMinute = parseInt('48');
        var isPlay = "on";
		var ROOT_URL = "{$urls}";
        $(function () {
            // 点赞
            $(".praise_btn_icon").on("click", function () {
                $this = $(this);
                $.ajax({
                    url: "{php echo $this->createMobileUrl('dongtaiajax',array('op'=>'videodz'))}",
                    data: {
						weid: "{$weid}",
						schoolid: "{$schoolid}",
                        userid: "{$it['id']}",
						videoid: "{$videoid}",
						bj_id: "{$student['bj_id']}",
						thisop: "{$_GPC['op']}",
                    },
                    dataType: "json",
                    type: "post",
                    success: function (data) {
                        $this.toggleClass("act");
                        var praiseNum = parseInt($this.text())
                        if ($this.hasClass("act")) {
                            $this.text(praiseNum + 1);
                        } else {
                            $this.text(praiseNum - 1);
                        }
                    }
                });
            });

            // 评论
            $(".reply_btn").click(function () {
                var content = $(".reply_input").val().trim();
				var myicon = $("#myicon").val();
				var allowpy = $("#allowpy").val();
                if (content == "") {
                    jTips('内容不能为空!');
                    return false;
                }
				if (allowpy == 2){
                    jTips('抱歉!本画面未开启评论功能');
                    return false;				
				}
                var sensitive_words = "非法|不合法|三聚氰胺|色情|法轮功|涉黄|吸毒|邪教|台独|藏独|伊斯兰教|鸡巴|妓女|枪毙|强暴|艾滋病|性交|恐怖分子|自慰|约炮|肛交|毒品|艾滋|";
                var filter = sensitive_words.split('|');
                for (var i = 0; i < filter.length; i++) {
                    var filter_word = filter[i].trim();

                    if (filter_word == "")
                        continue;

                    if (content.indexOf(filter_word) > -1) {
                        jTips("请遵守国家法律法规，请勿发布暴力、谣言、色情等言论。内容含有非法词语：" + filter_word);
                        return false;
                    }
                }				
                $.ajax({
                    url: "{php echo $this->createMobileUrl('dongtaiajax',array('op'=>'videopl'))}",
                    type: 'post',
                    dataType: 'json',
                    async: false,
                    data: {
						weid: "{$weid}",
						schoolid: "{$schoolid}",
                        userid: "{$it['id']}",
						videoid: "{$videoid}",
						bj_id: "{$student['bj_id']}",
						thisop: "{$_GPC['op']}",
                        "commentContext": content
                    },
                    success: function (data) {
                        $(".bv_info_list").prepend('<li is_mine="true" comment_id="' + data.data + '"><a><div class="user_img"><img src="' + myicon +'" onerror="imgNotFind(this)"></div><div class="text"><div class="user_name">我</div><div class="comment_time">1分钟前</div><div class="clear1"></div><div class="comment_text">' + content + '</div></div></a></li>');
                        var praiseNum = parseInt($(".comment_btn_icon").text());
                        $(".comment_btn_icon").text(praiseNum + 1);
                        $(".reply_input").val("");
                        $(".reply_input").blur();
                        $(".default_comment").hide();
                    }
                });
            });

            // 点击自己写的评论，弹出删除按钮
            $(".bv_info_list").on("click", "li", function (e) {
                var is_mine = $(this).attr("is_mine");
                var comment_id = $(this).attr("comment_id");
                if (is_mine == "true") {
                    $(".del_comment_bg").show();
                    $(".del_comment_btn").attr("comment_id", comment_id);
                }
            });

            // 点击背景，隐藏删除按钮
            $(".del_comment_bg").on("click", function () {
                $(this).hide();
            });

            //删除自己发表的评论
            $(".del_comment_btn").on("click", function (e) {
                e.stopPropagation();
                e.preventDefault();
                var comment_id = $(this).attr("comment_id");
                var this_comment_li = $(".bv_info_list li[comment_id=" + comment_id + "]");
                $(".del_comment_bg").hide();
                this_comment_li.remove();
                if ($(".bv_info_list").children("li").length == 1) {
                    $(".default_comment").show();
                }
                var praiseNum = parseInt($(".comment_btn_icon").text());
                if (praiseNum - 1 >= 0) {
                    $(".comment_btn_icon").text(praiseNum - 1);
                }
                $.ajax({
                    url: "{php echo $this->createMobileUrl('dongtaiajax',array('op'=>'delmypl'))}",
                    type: "post",
                    dataType: "json",
                    data: {
                        "id": comment_id
                    },
                    success: function (data) {

                    }
                });
            })

           // window.setInterval(checkVideo, 60000);
        });

        function checkVideo() {
            if ($(".video_box").attr("isCheck") == "true" || $("#video").attr("src") == "") {
                return false;
            }

            nowMinute++;
            if (nowMinute >= 60) {
                nowHour++;
                nowMinute = 0;
                if (nowHour >= 24) {
                    nowHour = 0;
                }
            }

            var localTime = (nowHour < 10 ? "0" + nowHour : nowHour) + ":" + (nowMinute < 10 ? "0" + nowMinute : nowMinute) + ":00";

            if (localTime > "00:00:00" && localTime < "23:59:59") {
                isPlay = "on";
                return false;
            }

            if (localTime > "00:00:00" && localTime < "00:00:00") {
                isPlay = "on";
                return false;
            }

            if (localTime > "00:00:00" && localTime < "00:00:00") {
                isPlay = "on";
                return false;
            }

            isPlay = "off";
            $(".video_box").html('<div class="mask"><div class="mask-content">已到直播结束时间，下回再见！</div></div><video id="video" preload="auto" src="" poster="" controls="controls" webkit-playsinline></video>');
            $(".video_box").attr("isCheck", "true");
            location.reload();
        }

        function imgNotFind(img) {
            img.onerror = null;
            img.src = ROOT_URL + "{$school['spic']}";
        }

</script>
<script>
$(function() {
	    WeixinJSHideAllNonBaseMenuItem();
});


/**微信隐藏工具条**/
function WeixinJSHideAllNonBaseMenuItem(){
	if (typeof wx != "undefined"){
		wx.ready(function () {
			
			wx.hideAllNonBaseMenuItem();
		});
	}
}
</script>